#include "win_display_driver.h"
#include <cstdio>

void WinDisplayDriver::DrawStr(LPCWSTR str, const Rect*)
{
    HGDIOBJ hOldFont = NULL;
    HFONT hFont = CreateFont(
        36,           // 字体高度
        0,            // 字体宽度
        0,            // 旋转角度
        0,            // 基线倾斜角度
        FW_NORMAL,    // 字体粗细
        FALSE,        // 是否斜体
        FALSE,        // 是否下划线
        FALSE,        // 是否删除线
        ANSI_CHARSET, // 字符集
        OUT_DEFAULT_PRECIS,
        CLIP_DEFAULT_PRECIS,
        DEFAULT_QUALITY,
        DEFAULT_PITCH | FF_SWISS,
        L"Arial");
    SelectObject(m_hdc, hFont);

    SetTextColor(m_hdc, RGB(0, 0, 0));
    SetBkMode(m_hdc, TRANSPARENT);
    TextOutW(m_hdc, 10, 10, str, wcslen(str));
    DeleteObject(hFont);
}

void WinDisplayDriver::FillRect(const Rect* rt)
{
    RECT rect = {};
    HBRUSH m_hBrush = CreateSolidBrush(RGB(255, 0, 0));
    ::FillRect(m_hdc, &rect, m_hBrush);
    DeleteObject(m_hBrush);
}

void WinDisplayDriver::DrawRect(const Rect*)
{

}